package com.masterclient.app.modules.shop.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.eoner.baselibrary.utils.ScreenUtils;
import com.masterclient.app.R;
import com.masterclient.app.modules.shop.beans.StockExplainBean;

public class StockExplainAdapter extends BaseQuickAdapter<StockExplainBean.ExplainBean.ParagraphBean, BaseViewHolder> {

    public StockExplainAdapter(Context mContext) {
        super(R.layout.item_stock_explain);
        this.mContext = mContext;
    }

    @Override
    protected void convert(BaseViewHolder helper, StockExplainBean.ExplainBean.ParagraphBean item) {
        helper.setText(R.id.tv_title,item.title);
        helper.setText(R.id.tv_details,item.text);
        View viewItem  = helper.getView(R.id.view_item);
        if (helper.getLayoutPosition() == 0){
            RecyclerView.LayoutParams layoutParams = (RecyclerView.LayoutParams) viewItem.getLayoutParams();
            layoutParams.topMargin = ScreenUtils.dp2px(16);
            viewItem.setLayoutParams(layoutParams);
        }
    }
}
